edit_{$taxonomy}_{$field}
Filter HookDescription
Filters the taxonomy field to edit before it is sanitized. The dynamic portions of the filter name, `$taxonomy` and `$field`, refer to the taxonomy slug and taxonomy field, respectively.Hook Information
File Location |
wp-includes/taxonomy.php
View on GitHub
|
Hook Type | Filter |
Line Number | 1808 |
Hook Parameters
Type | Name | Description |
---|---|---|
mixed
|
$value
|
Value of the taxonomy field to edit. |
int
|
$term_id
|
Term ID. |
Usage Examples
Basic Usage
<?php
// Hook into edit_{$taxonomy}_{$field}
add_filter('edit_{$taxonomy}_{$field}', 'my_custom_filter', 10, 2);
function my_custom_filter($value, $term_id) {
// Your custom filtering logic here
return $value;
}
Source Code Context
wp-includes/taxonomy.php:1808
- How this hook is used in WordPress core
<?php
1803 * @since 2.3.0
1804 *
1805 * @param mixed $value Value of the taxonomy field to edit.
1806 * @param int $term_id Term ID.
1807 */
1808 $value = apply_filters( "edit_{$taxonomy}_{$field}", $value, $term_id );
1809
1810 if ( 'description' === $field ) {
1811 $value = esc_html( $value ); // textarea_escaped
1812 } else {
1813 $value = esc_attr( $value );
PHP Documentation
<?php
/**
* Filters the taxonomy field to edit before it is sanitized.
*
* The dynamic portions of the filter name, `$taxonomy` and `$field`, refer
* to the taxonomy slug and taxonomy field, respectively.
*
* @since 2.3.0
*
* @param mixed $value Value of the taxonomy field to edit.
* @param int $term_id Term ID.
*/
Quick Info
- Hook Type: Filter
- Parameters: 2
- File: wp-includes/taxonomy.php
Related Hooks
Related hooks will be displayed here in future updates.